using Xtensive.Orm;

namespace SalesPoint.Model
{
  [KeyGenerator(KeyGeneratorKind.None)]
  [TableMapping("Territories")]
  [HierarchyRoot]
  public class Territory : Entity
  {
    [Field(Length = 20), FieldMapping("TerritoryId"), Key]
    public string Id { get; private set; }

    [Field(Length = 50)]
    public string TerritoryDescription { get; set; }

    [Field]
    public Region Region { get; set; }

    [Field, Association(PairTo = "Territories")]
    public EntitySet<Employee> Employees { get; private set; }

    // Constructors

    public Territory(Session session, string id)
      : base(session, id)
    {
    }
  }
}